package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface SpecMapper extends Mapper<Spec> {

    /**
     * @Date: 15:12 2020/5/10
     * @Param: [cateName]
     * @return: com.changgou.entity.Result
     * @Description: 根据分类名称查询规格列表
     **/
    @Select("SELECT DISTINCT a.* FROM tb_spec a JOIN tb_category b ON a.template_id = b.template_id WHERE b.name=#{name}")
    List<Spec> findByCateName(@Param("name") String cateName);
}
